﻿using System;

namespace Quail
{
    /// <summary>
    /// Exception class you can use so that exceptions get logged with a specific status
    /// </summary>
    public class LogStatusException : Exception, ILogStatus
    {
        /// <summary>
        /// Creates a new instance of a LogStatusException with a default failure of LogStatus.Fail
        /// </summary>
        /// <param name="message"></param>
        public LogStatusException(string message)
            : this(LogStatus.Fail, message)
        {
        }


        /// <summary>
        /// Creates a new instance of a LogStatusException
        /// </summary>
        /// <param name="status"></param>
        /// <param name="message"></param>
        public LogStatusException(LogStatus status, string message)
            :base(message)
        {
            LogStatus = status;
        }

        /// <summary>
        /// Creates a new instance of a LogStatusException
        /// </summary>
        /// <param name="status"></param>
        /// <param name="message"></param>
        /// <param name="innerException"></param>
        public LogStatusException(LogStatus status, string message, Exception innerException)
            : base(message, innerException)
        {
            LogStatus = status;
        }

        
        /// <summary>
        /// Gets or sets the LogStatus
        /// </summary>
        public LogStatus LogStatus
        {
            get;
            set;
        }
    }
}
